libxc: fix incorrect scanning of pfn array in pagebuf during migration
authorShriram Rajagopalan <rshriram@cs.ubc.ca>
Thu, 3 Mar 2011 16:55:27 +0000 (16:55 +0000)
committerShriram Rajagopalan <rshriram@cs.ubc.ca>
Thu, 3 Mar 2011 16:55:27 +0000 (16:55 +0000)
commitdc55dcd8f1c3c6f134ae12917d099c84bb84c618
treec5203aa6e880fc0e1ca18b4a201c8c61462831e5
parent4804b5c5ae52f6718ca3e9699cdb96a5799b1d84
libxc: fix incorrect scanning of pfn array in pagebuf during migration

xc_domain_restore.c:apply_batch function makes two passes over the pfn_types
array in pagebuf to allocate the needed MFNs. The curbatch parameter to this
function specifies the array offset in pfn_types, from where the current scan
should begin. But this variable is not taken into account (index always starts
at 0) during the two passes. While this [bug] does not manifest itsef during
save/restore or live migration, under Remus, xc_domain_restore fails due to
corrupt guest page tables.

(This appears to have been broken by 21588:6c3d8aec202d which reverted
two changesets from before Remus support was added and hence
reintroduced some none-Remus compatible bits.)

Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxc/xc_domain_restore.c